package com.sunwayhorizo.health.common;

import java.util.Set;

import javax.ejb.Local;
import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;

import com.sunwayhorizo.health.business.dto.ResultsDTO;


@Local
public interface ValidateUtilLocal {
	/**
	 * 验证数据
	 * @param <T>
	 * 
	 * @Title: validate
	 * @param t 需验证对象
	 * @return boolean 是否验证通过
	 * @firstAuthor Obama
	 * @firstTime 2011-03-23 10:30:15
	 * @lastAuthor Obama
	 * @lastTime 2011-03-23 10:30:15
	 */
	<T> boolean verified(T t,Class<?>... groups);
	/**
	 * 验证数据
	 * @param <T>
	 * 
	 * @Title: getConstraintViolations
	 * @param t 需验证对象
	 * @return Set<ConstraintViolation<T>> 获取验证信息
	 * @firstAuthor Obama
	 * @firstTime 2011-03-23 10:30:15
	 * @lastAuthor Obama
	 * @lastTime 2011-03-23 10:30:15
	 */
	<T> Set<ConstraintViolation<T>> getConstraintViolations(T t,Class<?>... groups);
	/**
	 * 验证数据
	 * @param <T>
	 * 
	 * @Title: verifiedThrowsException
	 * @param t 需验证对象
	 * @throws ValidationException
	 * @firstAuthor Obama
	 * @firstTime 2011-03-23 10:30:15
	 * @lastAuthor Obama
	 * @lastTime 2011-03-23 10:30:15
	 */
	<T> void verifiedThrowsException(T t,Class<?>... groups)throws ValidationException;
	<T> ResultsDTO verifiedReturnResultsDTO(T t, Class<?>... groups)
			throws ValidationException;
	
}
